package frsf.cidisi.exercise.modelo.util;

public class Coordenada {

	private Integer x;
	private Integer y;

	public Coordenada() {
		x = 0;
		y = 0;
	}

	public Coordenada(Coordenada other) {
		this.x = other.getX();
		this.y = other.getY();
	}

	public Coordenada(Integer x, Integer y) {
		super();
		this.x = x;
		this.y = y;
	}

	public Integer getX() {
		return x;
	}

	public void setX(Integer x) {
		this.x = x;
	}

	public Integer getY() {
		return y;
	}

	public void setY(Integer y) {
		this.y = y;
	}

	@Override
	public boolean equals(Object c) {
		if (this == c) {
			return true;
		}
		if (c == null) {
			return false;
		}
		if (!(c instanceof Coordenada)) {
			return false;
		}

		Coordenada other = (Coordenada) c;

		if (x == null && other.x != null) {
			return false;
		} else if (!x.equals(other.x)) {
			return false;
		}
		if (y == null && other.y != null) {
			return false;
		} else if (!y.equals(other.y)) {
			return false;
		}
		return true;
	}
	
	@Override
	public String toString() {
		return "("+ this.x + "," + this.y + ")";
	}
}
